<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>智能排班系统</title>
    <meta name="description" content="智能排班系统">
    <meta name="keywords" content="智能排班系统">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>排班查询</h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>排班查询</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="block" style="margin-top: 20px">
        <el-date-picker
                v-model="selectMonth"
                type="month"
                placeholder="选择月">
        </el-date-picker>
        <el-input placeholder="姓名" v-model="queryUsername" style="width: 200px;"
                  class="filter-item"></el-input>
        <el-button @click="findPage()" class="dalfBut">查询</el-button>
    </div >


    <el-table size="small" current-row-key="id" :data="dataList" stripe highlight-current-row style="margin-top: 20px">
        <el-table-column type="index" align="center" label="序号"></el-table-column>
        <el-table-column prop="dutyDate" label="值班日期" align="center"></el-table-column>
        <el-table-column prop="username" label="值班人" align="center"></el-table-column>
        <el-table-column prop="tel" label="手机号码" align="center"></el-table-column>
        <el-table-column prop="job" label="职务" align="center"></el-table-column>
        </el-table-column>
    </el-table>
    </div>
</div>
</div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../js/vue.js"></script>
<script src="../plugins/elementui/index.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script src="../js/axios-0.18.0.js"></script>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            selectMonth:"",
            queryUsername: "",//查询条件用户名
            dataList: [],//当前页要展示的分页列表数据
        },
        //钩子函数，VUE对象初始化完成后自动执行
        created() {
            //调用分页查询方法完成分页查询
            this.findPage();
        },
        methods: {
            //查询
            findPage() {
                //发送ajax请求，进行分页查询
                axios.post("/user/findUserPage", param).then((res) => {
                    this.dataList = res.data.rows;
                });

            },
            showMessage(r) {
                if (r == 'Error: Request failed with status code 403') {
                    //权限不足
                    this.$message.error('无访问权限');
                    return;
                } else {
                    this.$message.error('未知错误');
                    return;
                }
            }
        }
    })
</script>
</html>